.tabs-outlet-container {
  width: 100%;
  height: 100%;
  overflow-y: hidden;
}

.tabs-container {
  flex: auto;
  width: 100%;
  height: 100%;
  overflow-y: hidden;

  .ant-tabs.tabs-content,
  .tabs-content > .ant-tabs-content-holder {
    height: 100%;

    .ant-tabs-content,
    .ant-tabs-tabpane {
      height: 100%;
    }
  }

  .ant-tabs.tabs-content {
    & > .ant-tabs-nav {
      margin-bottom: 0;
      position: relative;

      .ant-tabs-nav-wrap {
        height: 32px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0px 12px;

        .ant-tabs-nav-list {
          display: flex;
          align-items: center;
          gap: 3px;

          .ant-tabs-nav-add {
            width: 24px;
            height: 24px;
            min-width: 24px;
            border-radius: 4px;
            padding: 0;
            border: none;
            background-color: transparent;
            color: var(--requestly-color-text-default);

            &:hover {
              background: var(--requestly-color-white-t-20, rgba(255, 255, 255, 0.12));
            }

            svg {
              width: 10px;
              height: 14px;
            }
          }
        }

        .ant-tabs-tab {
          padding: 0 4px;
          width: 144px;
          max-width: 144px;
          border-radius: 4px;
          background: rgba(255, 255, 255, 0.04);
          height: 24px;
          .ant-tabs-tab-btn {
            width: 100%;
            overflow: hidden;
          }

          .tab-close-button {
            flex-shrink: 0;
            display: none;
          }

          &:hover {
            border-radius: 4px;
            border: 1px solid var(--requestly-color-white-t-10, rgba(255, 255, 255, 0.06));
            background: var(--requestly-color-white-t-10, rgba(255, 255, 255, 0.06));
            .tab-close-button {
              display: flex;
              border-radius: 4px;
              &:hover {
                background: var(--requestly-color-white-t-20, rgba(255, 255, 255, 0.12));
              }
            }

            .unsaved-changes-indicator {
              display: none;
            }
          }
        }

        .ant-tabs-tab + .ant-tabs-tab {
          margin: 0;
          position: relative;
        }

        .ant-tabs-tab-active {
          border-radius: 4px;
          border: 1px solid var(--requestly-color-white-t-20, rgba(255, 255, 255, 0.12));
          background-color: var(--requestly-color-white-t-20, rgba(255, 255, 255, 0.12));

          &:hover {
            background-color: var(--requestly-color-white-t-20, rgba(255, 255, 255, 0.12));
          }

          .tab-title {
            .icon,
            .title {
              color: var(--requestly-color-text-default);
            }
          }
        }
      }

      .ant-tabs-nav-operations {
        display: flex;
        height: 24px;
        margin-top: 2px;
        gap: var(--requestly-space-4, 8px);
        width: 30px;
        .ant-tabs-nav-more {
          display: none;
        }

        .ant-tabs-nav-add {
          width: 24px;
          height: 24px;
          min-width: 24px;
          border-radius: 4px;
          padding: 0;
          border: none;
          background-color: transparent;
          color: var(--requestly-color-text-default);
          margin-top: 1px;
          &:hover {
            background: var(--requestly-color-white-t-20, rgba(255, 255, 255, 0.12));
          }

          // Add shadow effect when more icon is visible (indicating overflow)
          &::after {
            content: "";
            position: absolute;
            top: 0;
            right: 55px;
            bottom: 0;
            width: 42px;
            background: linear-gradient(270deg, #1a1a1a 0%, rgba(26, 26, 26, 0) 100%);
            pointer-events: none;
            z-index: 1;
            margin-bottom: 1px;
          }

          svg {
            width: 10px;
            height: 14px;
          }
        }
      }
    }
  }

  .tab-title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;

    &:hover {
      .tab-actions {
        display: flex;
      }
    }

    .tab-title {
      user-select: none;
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;

      .icon {
        display: flex;
        width: 12px;
        height: 14px;
        justify-content: center;
        flex-shrink: 0;
        color: var(--requestly-color-text-subtle, #bbb);
      }

      .title {
        text-align: left;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        padding: 8px 0;
        padding-right: 26px;
        color: var(--requestly-color-text-subtle, #bbb);
        font-size: var(--requestly-font-size-xs, 11px);
        font-style: normal;
        font-weight: 400;
        line-height: var(--requestly-font-line-height-xs, 15px);
        flex: 1;
        min-width: 0;
      }
    }

    .tab-actions {
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      position: absolute;
      right: 0;

      .tab-close-button {
        height: 16px;
        width: 16px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;

        svg {
          width: 10px;
          height: 14px;
        }
      }
    }

    .unsaved-changes-indicator {
      flex-shrink: 0;
      width: 18px;
      display: flex;
      align-items: center;
      justify-content: center;

      &::after {
        content: "";
        display: block;
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: var(--requestly-color-primary-soft);
      }
    }
  }
}

.tabs-content-more-dropdown {
  .ant-tabs-dropdown-menu {
    width: 280px;
    max-height: 480px;
    background-color: var(--requestly-space-4-color-surface-1, #282828);
    border-radius: 4px;

    .ant-tabs-dropdown-menu-item {
      .tab-title-container {
        display: flex;
        align-items: center;
        gap: 4px;
        flex-wrap: nowrap;
        font-size: var(--requestly-font-size-xs, 11px);
        max-width: 250px;

        .tab-title {
          display: flex;
          align-items: center;
          gap: 4px;
          flex-wrap: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;

          .icon {
            display: flex;
            align-items: center;
            font-size: 13px;
          }

          .title {
            font-size: inherit;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            max-width: 170px;
          }
        }
      }

      .tab-actions {
        margin-left: auto;
      }
    }
  }
}

.tabs-more-icon {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 25px;
  border-radius: 4px;
  padding: 0;
  border: none;
  background-color: transparent;
  color: var(--requestly-color-text-default);
  font-size: small;
  margin-top: -1px;
  margin-left: 5px;
  &:hover {
    background: var(--requestly-color-white-t-20, rgba(255, 255, 255, 0.12));
  }
}
.tabs-more-icon-open {
  background: var(--requestly-color-white-t-20, rgba(255, 255, 255, 0.12));
}

.tabs-operations-popover {
  width: 280px;
  max-height: 532px;
  background-color: var(--requestly-space-4-color-surface-1, #282828);
  border-radius: 4px;
  padding: 0;
  top: 75px !important;
  overflow: hidden;

  .ant-popover-inner-content {
    padding: 0;
    background-color: var(--requestly-color-surface-1, #282828);
    width: 100%;
    padding-right: 0px;
  }
}
